<style>
    table > tbody > tr > td, table > thead > tr > th {
        border: 1px solid #000000 !important;
        font-size: 16px;
    }
</style>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">档案表 预览/打印</div>
                </div>
                <div class="widget-body  am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success" id="btnPrint"
                                            onclick="print()">
                                        <span class="am-icon-plus"></span> 打印
                                    </button>
                                    <button type="button" onclick="loadPage('machineryInfo/listUI')"
                                            class="am-btn am-btn-default am-btn-danger ">返回
                                    </button>
                                </div>

                                <div class="widget-body am-fr" th:each="record:${machineryInfoList}">

                                    <div class="demo2-bg" id="printContent">
                                        <div style="height: 50px;">
                                        </div>
                                        <table class="table table-bordered am-text-nowrap table-responsive text-center"
                                               style="margin-top: 0px;position:relative;width:600px;height:280px;left: 40px">
                                            <!--<div style="position:absolute;width:600px;height:300px;top:40px;left:20px;z-index:1">-->
                                                <!--<img src="https://api.gcjxglzx.com/images/cms-admin-background/targerTextPath/more.jpg"-->
                                                     <!--style="height: 100%;width: 100%;filter:alpha(opacity=30);-moz-opacity:0.5;opacity:0.5; -khtml-opacity: 0.5;"/>-->
                                            <!--</div>-->
                                            <thead>
                                            </thead>
                                            <tbody class="print-border">
                                            <tr class="">
                                                <td width="90px" height="39px">
                                                    <!--<span>1.姓名/名称</span>-->
                                                </td>
                                                <td width="180px" height="50px"><span
                                                        th:text="${record.ownerName != null} ? ${record.ownerName} : ''"></span>
                                                </td>
                                                <td width="90px">
                                                    <!-- <span>2.证件号码</span>-->
                                                </td>
                                                <td width="180px"><span
                                                        th:text="${record.identityNum != null} ? ${record.identityNum} : ''"></span>
                                                </td>
                                            </tr>
                                            <tr class="print-tr-margin print-tr-border">
                                                <td height="39px">
                                                    <!--<span>3.排放登记</span>-->
                                                </td>
                                                <td>
                                                    <span th:text="${record.emissionRegistration != null} ? ${record.emissionRegistration} : ''"></span>
                                                </td>
                                                <td>
                                                    <!-- <span>4.设备编号</span>-->
                                                </td>
                                                <td>
                                                    <span th:text="${record.deviceID != null} ? ${record.deviceID} : ''"></span>
                                                </td>
                                            </tr>
                                            <tr class="text-center">
                                                <td height="39px">
                                                    <!--  <span>5.机械品牌</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.brands != null} ? ${record.brands} : ''"></span>
                                                </td>
                                                <td>
                                                    <!--<span>6.机械颜色</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.colour != null} ? ${record.colour} : ''"></span>
                                                </td>
                                            </tr>
                                            <tr class="text-center">
                                                <td height="39px">
                                                    <!-- <span>7.机械类型</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.type != null} ? ${record.type} : ''"></span>
                                                </td>
                                                <td colspan="1">
                                                    <!--<span>8.生产国别</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.country != null} ? ${record.country} : ''"></span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="39px">
                                                    <!--<span>9.整机架号</span>-->
                                                </td>
                                                <td>
                                                    <span th:text="${record.bigShelfNum != null} ? ${record.bigShelfNum} : ' '"></span>
                                                </td>
                                                <td>
                                                    <!--<span>10.燃油类型</span>-->
                                                </td>
                                                <td>
                                                    <span th:text="${record.fuel != null} ? ${record.fuel} : ' '"></span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="39px">
                                                    <!--<span>11.发动机号</span>-->
                                                </td>
                                                <td><span
                                                        th:text="${record.enginePlateNum != null} ? ${record.enginePlateNum} : ''"></span>
                                                </td>
                                                <td>
                                                    <!--<span>12.整机质量</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.machineQuality != null} ? ${record.machineQuality} : ''"></span>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="39px">
                                                    <!-- <span>13.出厂日期</span>-->
                                                </td>
                                                <td colspan="1">
                                                <span th:if="${record.dateOfProduction != null}"
                                                      th:text="${#dates.format(record.dateOfProduction, 'yyyy-MM-dd')}"></span>
                                                </td>
                                                <td>
                                                    <!--<span>14.核载质量</span>-->
                                                </td>
                                                <td colspan="1">
                                                    <span th:text="${record.nuclearLoadingQuality != null} ? ${record.nuclearLoadingQuality} : ''"></span>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                        <div style="padding-top: 150px;width: 700px;">
                                            <div style="width: 700px;float:left ;position: relative;">
                                                <img src="https://api.gcjxglzx.com/images/Qrcorde/qrcode/qrcode.jpg"
                                                     width="120px" height="120px"
                                                     style="float:left;"/>
                                                <img src="https://api.gcjxglzx.com/images/Qrcorde/WeChatgzh/wxgzh.jpg"
                                                     width="120px" height="120px"
                                                     style="float:right;"/>
                                            </div>
                                            <div style="float:left;">
                                                <span>查询真伪</span>
                                            </div>
                                            <div style="float:right;">
                                                <span>微信公众号</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{/ui/js/jQuery.print.js}"/>

<script type="text/javascript">
    function print() {
        $("#printContent").print({
            globalStyles: true,//是否包含父文档的样式，默认为true
            mediaPrint: false,//是否包含media='print'的链接标签。会被globalStyles选项覆盖，默认为false
            stylesheet: null,//外部样式表的URL地址，默认为null

            noPrintSelector: ".no-print",//不想打印的元素的jQuery选择器，默认为".no-print"
            append: null,//将内容添加到打印内容的后面
            prepend: null//将内容添加到打印内容的前面，可以用来作为要打印内容
            //deferred:
            //   $.Deferred()//回调函数
        });
    }
</script>
